package com.kaifamiao.date1109;

public class Rooster {
	
	private String name ;
	private int weight ;
	private int age ;
	
	public Rooster(String name, int weight, int age) {
		super();
		this.name = name;
		this.weight = weight;
		this.age = age;
	}

	@Override
	public boolean equals( Object another ) {
		if( this == another ) {
			return true ;
		}
		
		if( another == null ) {
			return false ;
		}
		
		if( this.getClass() != another.getClass() ) {
			return false ;
		}
		
		Rooster r = (Rooster) another;
		
		return name.equals( r.name ) && weight == r.weight && age == r.age ;
	}

	@Override
	public String toString() {
		return "Rooster [name=" + name + ", weight=" + weight + ", age=" + age + "]";
	}

}
